package com.evan.common.bit;

public enum ZkServerModeEnum {
    FOLLOWER("follower"),
    LEADER("leader"),
    UNKNOWN("unknown")
    ;
    String val;
    ZkServerModeEnum(String val){
        this.val = val;
    }

    public String getVal() {
        return val;
    }

    public void setVal(String val) {
        this.val = val;
    }

    public String getValue(){
        return this.val.toString();
    }

    public static ZkServerModeEnum getInstance(String val){
        for (ZkServerModeEnum mode : ZkServerModeEnum.values()) {
            if(mode.val.equals(val)){
                return mode;
            }
        }
        return null;
    }
}
